﻿@model PagedList<RBS.Core.Model.V_BatchList>
@using Webdiyer.WebControls.Mvc
@{
    ViewBag.Title = "优惠卷赠送列表";
    Layout = "~/Views/Shared/_Layout.cshtml"; 
}
<script>
    $(function () {
        $("#btnDelete").click(function () {
            var f_str = "";
            $(".ltable :checkbox[id='chkId']").each(function () {
                if (this.checked && this.value != "undefined") {
                    f_str += this.value + ',';
                }
            }); 
            $.dialog.confirm("删除记录后不可恢复，您确定吗？", function () {
                var url = '@Url.Action("AdminUserDelete")?ids=' + f_str;
                $.ajax({
                    url: url,
                    type: "post",
                    dataType: 'json',
                    success: function (data) {
                        if (data.IsSuccess) {
                            $.dialog.alert(data.Msg);
                            loadPage(data.Data);
                        }
                        else {
                            //  $("#msgtip").text(data.Msg);
                            $.dialog.alert(data.Msg);
                        }
                    }
                }); 
            });
             return false;
         });
 
    });
</script>
 
 
<!--导航栏-->
<div class="location">
  <a href="javascript:history.back(-1);" class="back"><i></i><span>返回上一页</span></a>
  <a href="@Url.Action("Main", "Home")" class="home"><i></i><span>首页</span></a>
  <i class="arrow"></i>
  <span>@ViewBag.Title</span>
</div>
<!--/导航栏--> 
<!--工具栏-->
<div class="toolbar-wrap">
    <div id="floatHead" class="toolbar">
        <div class="l-list">
            <ul class="icon-list">
                <li>
                    @{
                        if (ViewBag.Action != RBS.Common.RBSEnums.ActionEnum.Show )
                        { 
                          @Html.Raw(" <a class=\"add\" href=\"GiftUser?apid="+@ViewBag.apid+"\"><i></i><span>新增</span></a>")
                        }
                    }
              

                </li>
               @* <li><a class="all" href="javascript:;" onclick="checkAll(this);"><i></i><span>全选</span></a></li>
                <li>
                    <a id="btnDelete" class="del" href="#"><i></i><span>删除</span></a>
                </li>*@
            </ul>
        </div>
        <div class="r-list">
            @using (Html.BeginForm("#", "Sys", new RouteValueDictionary { { "id", "" } }, FormMethod.Get))
            {
                <input id="kword" name="kword" type="text" class="keyword" value="@Request.QueryString["kword"]"/>
                <input type="submit" value="查询" class="btn-search" accesskey="S" /> 
            }
        </div>
    </div>
</div>
<!--/工具栏--> 
<!--列表--> 
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
  <tr>
  <th width="8%"></th>
    	@*  		<th align="left"> Id</th>
					<th align="left"> 发放Id</th>*@
					<th align="left"> 批次号</th>
      <th align="left"> 发放时间</th>   <th align="left"> 状态</th>
      <th align="left"> 接收人</th>
   
      	<th align="left"> 用户使用状态</th>
		   
 @*   <th width="8%">操作</th>*@
  </tr> 
@if (null != ViewData.Model)
{
    foreach (var item in ViewData.Model)
    {
  <tr>
   <td align="center"> 
       @*  <input type="checkbox" id="chkId" value="@item.Id" class="checkall" style="vertical-align: middle;" /> 
                <input id="hidId" type="hidden" value="@item.Id"/>  *@
      </td>
         @*			<td align="left"> 
			     @Html.DisplayFor(modelItem => item.Id)
			</td>
					<td align="left"> 
			     @Html.DisplayFor(modelItem => item.AP_Id)
			</td>*@
					<td align="left"> 
			     @Html.DisplayFor(modelItem => item.BatchNo)
			</td>  <td align="left"> 
          @Html.DisplayFor(modelItem => item.BatchTime)
      </td>
					
					<td align="left"> 
					    @{
					        var status = "正常";
                            switch (@item.ABStatus)
					        {
                                case 1:
					                status = "作废";
                                    break;
                                case 3:
                                    status = "已使用";
                                    break;
                                case 4:
                                    status = "已赠与";
                                    break;
                                case 5:
                                    status = "已过期";
                                    break;              
					        }
                            @Html.Raw(status)
                        }
			</td>
    <td align="left"> 
			     @Html.DisplayFor(modelItem => item.U_Name)
			</td>
      	<td align="left"> 
			    @{
                            
                            switch (@item.ALStatus)
                            {
                                case 1:
                                    status = "作废";
                                    break;
                                case 3:
                                    status = "已使用";
                                    break;
                                case 4:
                                    status = "已赠与";
                                    break;
                                case 5:
                                    status = "已过期";
                                    break;
                                default:
                                    status = "正常";
                                    break;
                            }
                            @Html.Raw(status)
                        }
			</td>
  @*  <td align="center">
   				 @Html.ActionLink("修改", "#", new { id = item.Id, action = @RBS.Common.RBSEnums.ActionEnum.Edit })
    </td>*@
  </tr>
    }
}
</table> 
<!--/列表--> 
<!--内容底部-->
<div class="line20">
</div>
<div class="pagelist">
    <div class="l-btns">
        <span>显示</span> <span>10 条/页</span><span>共 @Model.TotalPageCount 页 @Model.TotalItemCount 条记录，当前为第 @Model.CurrentPageIndex 页</span>
    </div>
    @Html.Pager(Model, new PagerOptions { PageIndexParameterName = "id", ShowPageIndexBox = true, PageIndexBoxType = PageIndexBoxType.DropDownList, ShowGoButton = false, CurrentPagerItemWrapperFormatString = "<span class=\"current\">{0}</span>" }, new { id = "PageContent", @class = "default" })
    @section Scripts{@{Html.RegisterMvcPagerScriptResource();}}
</div> 
<!--/内容底部-->
 
 
 